package com.qf.pojo;

/**
 * @author Mr.Liu
 * @date 2021/11/27 9:34
 * 封装购物车项
 */

public class CartItem {
    private Product product;//商品实体
    private int productCount;//商品数量
    private Double subtotalAmount = 0.0;//小计金额

    public CartItem() {
    }

    public CartItem(Product product, int productCount) {
        this.product = product;
        this.productCount = productCount;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public int getProductCount() {
        return productCount;
    }

    public void setProductCount(int productCount) {
        this.productCount = productCount;
    }

    public Double getSubtotalAmount() {
        return this.productCount*this.product.getShop_price();
    }

    public void setSubtotalAmount(Double subtotalAmount) {
        this.subtotalAmount = subtotalAmount;
    }
}
